<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "shop");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>

<ul class="nav nav-tabs nav-tabs-component " style="margin-bottom: 0px;">
	<li class="active"><a href="#customer-tab" data-toggle="tab" >订单详情</a></li>
	<li><a href="#payment-tab" data-toggle="tab" >收款记录</a></li>
	<li><a href="#customerRecord-tab" data-toggle="tab" >欠款记录</a></li>
</ul>
<div class="tab-content">
	<div class="tab-pane active" id="customer-tab">
		<t:panel cssClass="panel-flat form-detailed" customBody="true" customHead="true">
			<div class="detailed-navbar-content panel-body">
				<t:form modelAttribute="customer" action="/shop/customer/save" method="post" cssClass="form-horizontal">
					<div class="hide">
						 <t:hidden path="customerId"/>
		 				 <t:hidden path="deleteMark"/>	
		 				 <t:hidden path="createUserName"/>
				 		 <t:hidden path="createUserId"/>
				 		 <t:hidden path="createDate"/>
				 		 <t:hidden path="shopId"/>
				 		 <t:hidden path="customerDebt"/>
				 		 <t:hidden path="paymentMoney"/>
					</div>
		            <t:formgroup>
		                <t:label path="customerName" cssClass="col-sm-2 col-xs-2" />
		                <t:input path="customerName" colClass="col-sm-4 col-xs-4" />
		                <t:label path="customerTel" cssClass="col-sm-2 col-xs-2" />
		                <t:input path="customerTel" colClass="col-sm-4 col-xs-4" />
		            </t:formgroup>
		            <t:formgroup>
		                <t:label path="classifyId" cssClass="col-sm-2 col-xs-2" />
		                <t:select2 placeholder="选择客户类型" path="classifyId" colClass="col-sm-4 col-xs-4" allowClear="true" cssClass="require" />
		               
		            </t:formgroup>
				</t:form>
			</div>
			<t:panelFoot headingBtnCssClass="heading-btn pull-right-important">
				<c:if test="${t_type ne 3 }">
					<t:button icon="icon-floppy-disk" onclick="saveData()" laddaType="progress" cssClass="btn-info" csize="sm">保存</t:button>
				</c:if>
			</t:panelFoot>
		</t:panel>
	</div>
	<div class="tab-pane" id="payment-tab">
		<iframe id="paymentIframe" name="paymentIframe" scrolling="auto" frameborder="0"
				scrolling="yes" width="100%" height="100%"  data-src="<c:url value='/shop/payment/index?customerId=${customer.customerId }&level=5'/>">
        </iframe>
	</div>
	<div class="tab-pane" id="customerRecord-tab">
		<iframe id="customerRecordIframe" name="customerRecordIframe" scrolling="auto" frameborder="0"
				scrolling="yes" width="100%" height="100%"  data-src="<c:url value='/shop/customerRecord/index?customerId=${customer.customerId }'/>">
        </iframe>
	</div>
</div>
<script type="text/javascript">
$(function(){
	iframeLazyOpen();
	tabpaneResize();
});

function iframeLazyOpen(){
	$(".nav.nav-tabs.nav-tabs-component li a").click(function(){
		var iframeTab = $(this).attr("href");
		var iframeId = iframeTab.substring(0,iframeTab.indexOf("-")) + "Iframe";
		$(iframeId).attr("src",$(iframeId).attr("data-src"));
	});
}

function tabpaneResize(){
	$(".tab-pane").height($(window).height() - 45);	
	$(window).bind("resize",function(){$(".tab-pane").height($(window).height() - 45)});	
}
function saveData(lBtn){
	if (!$("form:first").valid()){
		return;
	}
	lBtn.start();
	$("form:first").submit();
}	


</script>
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formtags.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>
